package com.csu.tour.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csu.tour.entity.Booking;
import com.csu.tour.mapper.BookingMapper;
import com.csu.tour.service.BookingService;
import org.springframework.stereotype.Service;

@Service
public class BookingServiceImpl extends ServiceImpl<BookingMapper, Booking> implements BookingService {

    @Override
    public Booking getBookingByRoomId(int roomId) {
        return this.baseMapper.selectOne(new LambdaQueryWrapper<Booking>().eq(Booking::getRoomId, roomId));
    }
}
